<template>
	<view class="fee">
		<view class="">
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar leftText="我的缴费" :autoBack="true">
			</u-navbar>
		</view>
		<view class="con-body" style=" background-color: #f8f8f8;">

			<view style="background-color: #FFFFFF;margin-top: 1px;">
				<u-tabs :list="tabs" @click="click" lineColor="#0B868E" :current="current" @change="changeTabs"></u-tabs>
			</view>

			<view class="main-service uni-cell-90" style="width: 96%; margin-left: 2%;box-shadow: none;">
				<view class="user-list">
					<view>
						<view class="list_con" v-for="(item, ind) in feeList" >
							<view style="width:100%">
								<view class="u-rela u-border-bottom" style="padding-bottom:15rpx;">
									<view style="display: inline-block;margin-right:20rpx;"><u-icon :name="item.icon" color="#2979ff" size="16"></u-icon></view>
									
									<view class="" style="display: inline-block;font-size: 30rpx;color:#333;">
										<text>{{item.title}} | {{item.status_label}}</text>
									</view>
									<view class="u-abso" style="right:20rpx;top:0;color:red;">￥ {{item.amount_real}}</view>
								</view>
								<view style="font-size: 28rpx;line-height: 50rpx; color: #666666;">订单号：{{item.order_no}}</view>
								<view style="width:100%;font-size: 24rpx;line-height: 50rpx; color: #999999;">{{item.order_remark}}</view>
								<view style="font-size: 24rpx; line-height: 50rpx;color: #666666;">{{item.time}}</view>
							</view>
							
						</view>
					</view>
					<u-empty :show="showEmpty" mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png">
					</u-empty>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getMyOrders} from "@/service/propertyService.js";
	export default {
		data() {
			return {
				current: 0,
				tabs: [{
						name: '全部'
					},
					{
						name: '物业费'
					},
					{
						name: '车位费'
					}
				],
				feeList: [],
				showEmpty: false
			}
		},
		onLoad() {
			getMyOrders().then(this.getMyOrders);
		},
		methods: {
			getMyOrders(e){
				this.feeList = [];
				if(e.code == 200){
					this.showEmpty = false;
					this.feeList = e.result;
				}else{
					this.showEmpty = true;
				}
			},
			changeTabs(e) {
				this.current = e.index;
				if(this.current == 0){
					getMyOrders().then(this.getMyOrders);
				}else{
					getMyOrders({type: this.current}).then(this.getMyOrders);
				}
			}
		}
	}
</script>

<style>
	page{
		background-color: #f8f8f8;
	}
	.list_con{
		padding:20rpx;
		border-bottom: 15rpx solid #f8f8f8;
	}
	.list_con:last-child{
		border:none;
	}
</style>
